let obj1 = {a: 123};

function changeThis(...args) {
  console.log(...args, this);
  return 123;
}

changeThis.prototype.aaa = function () {
  console.log('aaa');
};

Function.prototype.myBind = function (target, ...args1) {

  let that = this;

  const bindFn = function (...args2) {
    let res = that.myCall(target, ...args1, ...args2);
    return res
  };
  bindFn.prototype = Object.create(that.prototype);

  return bindFn

};


// let changeFn = changeThis.bind(obj, 123, 213);
let changeFn = changeThis.myBind(obj1, 123, 213);

let res1 = changeFn(456);
let cf = new changeFn();
cf.aaa();

console.log(res1);
